package Dict;

/**
 * Interface definition: Dictionnary.
 * 
 * @author OpenORB Compiler
 */
public class _DictionnaryStub extends org.omg.CORBA.portable.ObjectImpl
        implements Dictionnary
{
    static final String[] _ids_list =
    {
        "IDL:Dict/Dictionnary:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = Dict.DictionnaryOperations.class;

    /**
     * Operation addEntity
     */
    public void addEntity(String term, Dict.CategoryValue cat, Dict.PropertyType props, String def)
        throws Dict.TermExisted, Dict.CategoryAndPropsNotMatch
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("addEntity",true);
                    _output.write_string(term);
                    Dict.CategoryValueHelper.write(_output,cat);
                    Dict.PropertyTypeHelper.write(_output,props);
                    _output.write_string(def);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.TermExistedHelper.id()))
                    {
                        throw Dict.TermExistedHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(Dict.CategoryAndPropsNotMatchHelper.id()))
                    {
                        throw Dict.CategoryAndPropsNotMatchHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("addEntity",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    _self.addEntity( term,  cat,  props,  def);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation delEntity
     */
    public void delEntity(String term)
        throws Dict.TermNotFound
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("delEntity",true);
                    _output.write_string(term);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.TermNotFoundHelper.id()))
                    {
                        throw Dict.TermNotFoundHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("delEntity",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    _self.delEntity( term);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation modifDefinition
     */
    public void modifDefinition(String term, String newdef)
        throws Dict.TermNotFound
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("modifDefinition",true);
                    _output.write_string(term);
                    _output.write_string(newdef);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.TermNotFoundHelper.id()))
                    {
                        throw Dict.TermNotFoundHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("modifDefinition",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    _self.modifDefinition( term,  newdef);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation findEntity
     */
    public Dict.Entity findEntity(String term)
        throws Dict.TermNotFound
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("findEntity",true);
                    _output.write_string(term);
                    _input = this._invoke(_output);
                    Dict.Entity _arg_ret = Dict.EntityHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.TermNotFoundHelper.id()))
                    {
                        throw Dict.TermNotFoundHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("findEntity",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.findEntity( term);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation sortDict
     */
    public void sortDict(boolean dir)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("sortDict",true);
                    _output.write_boolean(dir);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("sortDict",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    _self.sortDict( dir);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation loadDict
     */
    public int loadDict()
        throws Dict.DicFileNotFound
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("loadDict",true);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.DicFileNotFoundHelper.id()))
                    {
                        throw Dict.DicFileNotFoundHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("loadDict",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.loadDict();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation saveDict
     */
    public void saveDict()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("saveDict",true);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("saveDict",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    _self.saveDict();
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation dictLength
     */
    public int dictLength()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("dictLength",true);
                    _input = this._invoke(_output);
                    int _arg_ret = _input.read_long();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("dictLength",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.dictLength();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation firstEntity
     */
    public Dict.Entity firstEntity()
        throws Dict.DictEmpty
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("firstEntity",true);
                    _input = this._invoke(_output);
                    Dict.Entity _arg_ret = Dict.EntityHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.DictEmptyHelper.id()))
                    {
                        throw Dict.DictEmptyHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("firstEntity",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.firstEntity();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation lastEntity
     */
    public Dict.Entity lastEntity()
        throws Dict.DictEmpty
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("lastEntity",true);
                    _input = this._invoke(_output);
                    Dict.Entity _arg_ret = Dict.EntityHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.DictEmptyHelper.id()))
                    {
                        throw Dict.DictEmptyHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("lastEntity",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.lastEntity();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation nextEntity
     */
    public Dict.Entity nextEntity()
        throws Dict.DictEmpty
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("nextEntity",true);
                    _input = this._invoke(_output);
                    Dict.Entity _arg_ret = Dict.EntityHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.DictEmptyHelper.id()))
                    {
                        throw Dict.DictEmptyHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("nextEntity",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.nextEntity();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation prevEntity
     */
    public Dict.Entity prevEntity()
        throws Dict.DictEmpty
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("prevEntity",true);
                    _input = this._invoke(_output);
                    Dict.Entity _arg_ret = Dict.EntityHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(Dict.DictEmptyHelper.id()))
                    {
                        throw Dict.DictEmptyHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("prevEntity",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.prevEntity();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation myDefinition
     */
    public String myDefinition()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("myDefinition",true);
                    _input = this._invoke(_output);
                    String _arg_ret = _input.read_string();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("myDefinition",_opsClass);
                if (_so == null)
                   continue;
                Dict.DictionnaryOperations _self = (Dict.DictionnaryOperations) _so.servant;
                try
                {
                    return _self.myDefinition();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
